package org.example.crazy.controller;

import org.example.crazy.z_factory_model.factory.SimpleFactory;
import org.example.crazy.z_factory_model.product.AbstractFruit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author yzz
 * @CreateTime 2025/04/19
 * @描述: ClientController
 */
@RestController
@RequestMapping("/factory")
public class FactoryModelController {

    @Autowired
    private SimpleFactory factory;

    @GetMapping
    public void factoryTest(){
        AbstractFruit apple = factory.getFruit("apple");
        apple.eat();
    }
}
